//
//  ChangeTelViewController.m
//  CPetro
//
//  Created by ggx on 2017/3/8.
//  Copyright © 2017年 高广校. All rights reserved.
//

#import "ChangeTelViewController.h"

#import "LRMoreInputView.h"
@interface ChangeTelViewController ()

@end

@implementation ChangeTelViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"更改手机号";
    
    LRMoreInputView *lrMoreInputView = [[LRMoreInputView alloc]initItemWithFram:CGRectMake(0, 10, SCREEN_WIDTH, 150) andData:@[
  @{@"assistantName":@"原号码",@"assistantAccount":@"131****1230"},
  @{@"assistantName":@"获取验证码"},
  @{@"assistantName":@"新号码"},
  @{@"assistantName":@"获取验证码"}]];
    [self.view addSubview:lrMoreInputView];
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(lrMoreInputView.frame)+50, SCREEN_WIDTH - 20, 35)];
    [btn setTitle:@"完成" forState:0];
    [btn setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(submitAssistantData) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
}
-(void)submitAssistantData{
    //遍历图层 获取填写的数据
    for (UIView *subView in self.view.subviews) {
        if ([subView isKindOfClass:[LRMoreInputView class]]) {
            LRMoreInputView *moreView = (LRMoreInputView *)subView;
            for (UIView *subViewSecond in moreView.subviews) {
                if ([subViewSecond isKindOfClass:[LRInputView class]]) {
                    LRInputView *lrInputView = (LRInputView *)subViewSecond;
                    if (lrInputView.tag == 0) {
                        NSLog(@"填入的参数 0==%@--提示文字 == %@",lrInputView.inputText.text,lrInputView.tipName.text);//
                    }else if (lrInputView.tag == 1){
                        NSLog(@"填入的参数 1==%@--提示文字 == %@",lrInputView.inputText.text,lrInputView.tipName.text);//
                    }else if (lrInputView.tag == 2){
                        NSLog(@"填入的参数 2==%@--提示文字 == %@",lrInputView.inputText.text,lrInputView.tipName.text);//
                    }
                }
            }
        }
    }
    
    POP;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
